﻿using System.Configuration;

namespace LeisureNcre.Helper
{
    public static class ConfigHelper
    {
        /// <summary>
        /// 设置配置文件属性值
        /// </summary>
        /// <param name="value"></param>
        public static void SetKeyValue(string key, string value)
        {
            Configuration cfa = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            cfa.AppSettings.Settings[key].Value = value;
            cfa.Save();
            ConfigurationManager.RefreshSection("appSettings");
        }

        public static string GetKeyValue(string key)
        {
            return ConfigurationManager.AppSettings[key];
        }
    }
}
